* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 显示屏样式 */
.display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 15px;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.display-history {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    min-height: 20px;
    text-align: right;
}

.display-value {
    color: white;
    font-size: 32px;
    font-weight: bold;
    text-align: right;
    margin-top: 5px;
    word-break: break-all;
}

/* 按钮网格 */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
    width: 300px;
}

/* 按钮样式 */
.btn {
    padding: 20px;
    font-size: 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* 数字按钮 */
.btn.number {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn.number:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn.number:active {
    transform: translateY(0);
}

/* 运算符按钮 */
.btn.operator {
    background: rgba(255, 159, 64, 0.8);
    color: white;
}

.btn.operator:hover {
    background: rgba(255, 159, 64, 1);
    transform: translateY(-2px);
}

.btn.operator:active {
    transform: translateY(0);
}

/* 等号按钮 */
.btn.equals {
    background: rgba(72, 187, 120, 0.8);
    color: white;
}

.btn.equals:hover {
    background: rgba(72, 187, 120, 1);
    transform: translateY(-2px);
}

.btn.equals:active {
    transform: translateY(0);
}

/* 清除和退格按钮 */
.btn.clear {
    background: rgba(255, 99, 132, 0.8);
    color: white;
    grid-column: span 2;
}

.btn.clear:hover {
    background: rgba(255, 99, 132, 1);
    transform: translateY(-2px);
}

.btn.clear:active {
    transform: translateY(0);
}

.btn.backspace {
    background: rgba(108, 117, 125, 0.8);
    color: white;
    grid-column: span 2;
}

.btn.backspace:hover {
    background: rgba(108, 117, 125, 1);
    transform: translateY(-2px);
}

.btn.backspace:active {
    transform: translateY(0);
}

/* 计算器信息 */
.calculator-info {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .calculator {
        padding: 15px;
    }
    
    .buttons-grid {
        width: 280px;
        gap: 8px;
    }
    
    .btn {
        padding: 18px;
        font-size: 18px;
    }
    
    .display-value {
        font-size: 28px;
    }
}

/* 按钮点击动画 */
@keyframes buttonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.btn:active {
    animation: buttonClick 0.1s ease;
}